$(function() {
	// body...

	console.log(titleUrl);


    $.ajax({
        url: severUrl+'index.php?m=Web&a=search&searchName='+titleUrl.searchName,
        type: 'GET',
        dataType: 'JSONP'
    })
    .done(function(data) {
        console.log("success");
        console.log(data);
        articlelistFun(data.article_list);
        // tcdPageCode(data.page.totalPage)
        
    })
    .fail(function() {
        console.log("error");
    })
    .always(function() {
        console.log("complete");
    });







    function tcdPageCode(pageCounts){

        $(".tcdPageCode").createPage({
            pageCount:pageCounts,
            current:1,
            backFn:function(p){
                console.log(p);
                 $.ajax({
                    url: severUrl+'index.php?m=Web&a=article_List&cate_id='+titleUrl.cate_id+'&p='+p,
                    type: 'GET',
                    dataType: 'JSONP'
                })
                .done(function(data) {
                    console.log("success");
                    console.log(data);
                    articlelistFun(data.article_list);
                    
                })

            }
        });

    }


// article
 function articlelistFun(data){
    var Con = $('#articleLilist');
    var html = '';

    for (var i = 0; i < data.length; i++) {
    	html+='<li><a href="article.html?article_id='+data[i].article_id+'" class="clearfloat"><div class="imgC"><img src="'+data[i].image_url+'"></div><div class="word"><div class="head">'+data[i].title+'</div><p>'+data[i].seo_description+'</p></div></a></li>';
      
    }
    Con.html(html);
 }
// article end



})